.settings {
  display: flex;
  height: 100%;
  background: #f5f5f7;
}

html.dark-mode .settings {
  background: #1c1c1e !important;
}

.settings-sidebar {
  width: 220px;
  background: rgba(240, 240, 245, 0.8);
  backdrop-filter: blur(20px);
  border-right: 0.5px solid rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

html.dark-mode .settings-sidebar {
  background: rgba(40, 40, 42, 0.85) !important;
  border-right-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar-header {
  padding: 52px 16px 12px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

html.dark-mode .sidebar-header {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0;
}

html.dark-mode .sidebar-header h3 {
  color: #f5f5f7 !important;
}

.settings-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 13px;
  color: #1d1d1f;
}

html.dark-mode .nav-item {
  color: #f5f5f7 !important;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

html.dark-mode .nav-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

.nav-item.active {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--accent-color);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-label {
  flex: 1;
  font-weight: 500;
}

.settings-main {
  flex: 1;
  overflow-y: auto;
  background: white;
}

html.dark-mode .settings-main {
  background: #1c1c1e !important;
}

.settings-content {
  max-width: 800px;
  padding: 40px;
}

.content-header {
  margin-bottom: 32px;
}

.content-header h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 8px;
}

html.dark-mode .content-header h2 {
  color: #f5f5f7 !important;
}

.content-description {
  font-size: 14px;
  color: #86868b;
  margin: 0;
}

html.dark-mode .content-description {
  color: #aeaeb2 !important;
}

/* 壁纸预览 */
.wallpaper-preview {
  margin-bottom: 24px;
}

.preview-container {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.preview-label {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.wallpaper-types {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

html.dark-mode .wallpaper-types {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.type-btn {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark-mode .type-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f7 !important;
}

.type-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

html.dark-mode .type-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.type-btn.active {
  background: var(--accent-color);
  color: white;
}

.wallpaper-grid {
  margin-bottom: 32px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 16px;
}

html.dark-mode .section-title {
  color: #f5f5f7 !important;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.color-item {
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.color-item.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.color-checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #007aff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gradient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.gradient-item {
  aspect-ratio: 16/9;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.gradient-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.gradient-item.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}

.gradient-name {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

.gradient-checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--accent-color);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 通用设置 */
.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.setting-group-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

html.dark-mode .setting-group-title {
  color: #f5f5f7 !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.setting-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
  gap: 32px;
}

html.dark-mode .setting-item {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.setting-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  cursor: default;
}

html.dark-mode .setting-label {
  color: #f5f5f7 !important;
}

.setting-hint {
  font-size: 12px;
  color: #86868b;
  line-height: 1.5;
  margin: 0;
}

.action-btn {
  padding: 8px 20px;
  background: var(--accent-color);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.action-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(0);
}

html.dark-mode .action-btn {
  background: var(--accent-color) !important;
}

html.dark-mode .setting-hint {
  color: #aeaeb2 !important;
}

.setting-control {
  display: flex;
  gap: 8px;
}

.option-btn {
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  color: #1d1d1f;
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark-mode .option-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f5f5f7 !important;
}

.option-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

html.dark-mode .option-btn:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

.option-btn.active {
  background: var(--accent-color);
  color: white;
}

.accent-colors {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.accent-item {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
}

.accent-item:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.accent-item.selected {
  border-color: #fff;
  box-shadow:
    0 0 0 2px var(--accent-color, #007aff),
    0 4px 12px rgba(0, 0, 0, 0.25);
  transform: scale(1.1);
}

.accent-check {
  color: white;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.setting-select {
  padding: 6px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.setting-slider {
  width: 200px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #34c759;
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: #86868b;
}

html.dark-mode .placeholder {
  color: #aeaeb2 !important;
}

.placeholder-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.placeholder p {
  font-size: 14px;
}

/* Apple ID 登录界面 */
.appleid-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}

.login-card {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

html.dark-mode .login-card {
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.apple-logo {
  font-size: 64px;
  margin-bottom: 16px;
}

.login-header h3 {
  font-size: 24px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 8px;
}

html.dark-mode .login-header h3 {
  color: #f5f5f7 !important;
}

.login-header p {
  font-size: 14px;
  color: #86868b;
  margin: 0;
}

html.dark-mode .login-header p {
  color: #aeaeb2 !important;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: #1d1d1f;
}

html.dark-mode .form-label {
  color: #f5f5f7 !important;
}

.form-input {
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 15px;
  background: white;
  color: #1d1d1f;
  outline: none;
  transition: all 0.2s ease;
}

html.dark-mode .form-input {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #f5f5f7 !important;
}

.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.form-input::placeholder {
  color: #86868b;
}

html.dark-mode .form-input::placeholder {
  color: #aeaeb2 !important;
}

.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  padding: 12px 16px;
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.3);
  border-radius: 8px;
  color: #ff3b30;
  font-size: 13px;
  text-align: center;
}

html.dark-mode .login-error {
  background: rgba(255, 59, 48, 0.15) !important;
  border-color: rgba(255, 59, 48, 0.4) !important;
}

.login-submit-btn {
  padding: 14px 24px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
}

.login-submit-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

.login-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

html.dark-mode .login-footer {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

.login-link {
  font-size: 13px;
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.login-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.login-info {
  margin-top: 24px;
  max-width: 480px;
  padding: 16px;
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: 12px;
  text-align: center;
}

html.dark-mode .login-info {
  background: rgba(var(--accent-rgb), 0.15) !important;
}

.info-text {
  font-size: 13px;
  color: #86868b;
  margin: 0;
}

html.dark-mode .info-text {
  color: #aeaeb2 !important;
}

/* 已登录状态 */
.appleid-logged-in {
  max-width: 700px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: white;
  border-radius: 16px;
  margin-bottom: 32px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

html.dark-mode .user-profile {
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2) !important;
}

.user-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-color) 0%, rgba(var(--accent-rgb), 0.7) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
}

.user-name {
  font-size: 24px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 4px;
}

html.dark-mode .user-name {
  color: #f5f5f7 !important;
}

.user-email {
  font-size: 14px;
  color: #86868b;
  margin: 0;
}

html.dark-mode .user-email {
  color: #aeaeb2 !important;
}

.account-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.account-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

html.dark-mode .account-section {
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.account-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 16px;
}

html.dark-mode .account-section-title {
  color: #f5f5f7 !important;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

html.dark-mode .account-item {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.account-item:last-child {
  border-bottom: none;
}

.account-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.account-item-label {
  font-size: 14px;
  color: #1d1d1f;
  font-weight: 500;
}

html.dark-mode .account-item-label {
  color: #f5f5f7 !important;
}

.account-item-value {
  font-size: 12px;
  color: #86868b;
}

html.dark-mode .account-item-value {
  color: #aeaeb2 !important;
}

.account-item-btn {
  padding: 6px 16px;
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 13px;
  color: var(--accent-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

html.dark-mode .account-item-btn {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.account-item-btn:hover {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: var(--accent-color);
}

.account-actions {
  display: flex;
  justify-content: center;
}

.logout-btn {
  padding: 10px 32px;
  background: transparent;
  border: 1px solid rgba(255, 59, 48, 0.5);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #ff3b30;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: rgba(255, 59, 48, 0.1);
  border-color: #ff3b30;
}

.logout-btn:active {
  transform: scale(0.98);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .settings-sidebar {
    width: 180px;
  }

  .settings-content {
    padding: 24px;
  }

  .color-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }

  .gradient-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

